package com.carskeeper.mapper;

import com.carskeeper.model.body.dtos.QueryOwnerDto;
import com.carskeeper.model.body.dtos.UpdateStatusDto;
import com.carskeeper.model.body.pojos.BodyCarOwner;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface BodyCarOwnerMapper {
    /**
     * 分页查询车主主体
     * @param dto
     * @return
     */
    List<BodyCarOwner> findByPage(QueryOwnerDto dto);

    /**
     * 修改车主状态
     * @param dto
     */
    @Update("update body_car_owner set `status` = #{status} where `owner_id` = #{ownerId} ")
    void updateOwnerStatus(UpdateStatusDto dto);
}
